home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 25 / Mac Magazin and MacEasy Magazine CD - Issue 25.iso / Grafik & Text / BibTeX / BibTeX inputs / chicago.bst (.txt) < prev    next >
LaTeX Document  |  1996-02-11  |  37KB  |  1,326 lines

  1. %%% ====================================================================
  2. %%%  @BibTeX-style-file{
  3. %%%     filename        = "chicago.bst",
  4. %%%     version         = "4",
  5. %%%     date            = "28 August 1992",
  6. %%%     time            = "10:23:39 199",
  7. %%%     author          = "Glenn Paulley",
  8. %%%     address         = "Data Structuring Group
  9. %%%                        Department of Computer Science
  10. %%%                        University of Waterloo
  11. %%%                        Waterloo, Ontario, Canada
  12. %%%                        N2L 3G1",
  13. %%%     telephone       = "(519) 885-1211",
  14. %%%     FAX             = "(519) 885-1208",
  15. %%%     email           = "gnpaulle@bluebox.uwaterloo.ca",
  16. %%%     codetable       = "ISO/ASCII",
  17. %%%     keywords        = "BibTeX style, Chicago Manual of Style",
  18. %%%     supported       = "yes",
  19. %%%     abstract        = "A BibTeX bibliography style that follows the
  20. %%%                        `B' reference style of the 13th Edition of
  21. %%%                        the Chicago Manual of Style. A detailed
  22. %%%                        feature list is given below.",
  23. %%%     checksum        = "60511 1656 5157 37527",
  24. %%%     docstring       = "This file requires the use of chicago.sty.
  25. %%%                        The checksum field above contains a CRC-16
  26. %%%                        checksum as the first value, followed by the
  27. %%%                        equivalent of the standard UNIX wc (word
  28. %%%                        count) utility output of lines, words, and
  29. %%%                        characters.  This is produced by Robert
  30. %%%                        Solovay's checksum utility."
  31. %%%  }
  32. %%% ====================================================================
  33. % "Chicago" BibTeX style, chicago.bst
  34. % ===================================
  35. % BibTeX `chicago' style file for BibTeX version 0.99c, LaTeX version 2.09
  36. % Place it in a file called chicago.bst in the BibTeX search path.
  37. % You need to include chicago.sty as a \documentstyle option.
  38. % (Placing it in the same directory as the LaTeX document should also work.)
  39. % This "chicago" style is based on newapa.bst (American Psych. Assoc.)
  40. % found at ymir.claremont.edu.
  41. %   Citation format: (author-last-name year)
  42. %             (author-last-name and author-last-name year)
  43. %             (author-last-name, author-last-name, and author-last-name year)
  44. %             (author-last-name et al. year)
  45. %             (author-last-name)
  46. %             author-last-name (year)
  47. %             (author-last-name and author-last-name)
  48. %             (author-last-name et al.)
  49. %             (year) or (year,year)
  50. %             year or year,year
  51. %   Reference list ordering: alphabetical by author or whatever passes
  52. %    for author in the absence of one.
  53. % This BibTeX style has support for abbreviated author lists and for
  54. %    year-only citations.  This is done by having the citations
  55. %    actually look like
  56. %    \citeauthoryear{full-author-info}{abbrev-author-info}{year}
  57. % The LaTeX style has to have the following (or similar)
  58. %     \let\@internalcite\cite
  59. %     \def\fullcite{\def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
  60. %     \def\fullciteA{\def\citeauthoryear##1##2##3{##1}\@internalcite}
  61. %     \def\shortcite{\def\citeauthoryear##1##2##3{##2, ##3}\@internalcite}
  62. %     \def\shortciteA{\def\citeauthoryear##1##2##3{##2}\@internalcite}
  63. %     \def\citeyear{\def\citeauthoryear##1##2##3{##3}\@internalcite}
  64. % These TeX macro definitions are found in chicago.sty. Additional
  65. % commands to manipulate different components of a citation can be defined
  66. % so that, for example, you can list author's names without parentheses
  67. % if using a citation as a noun or object in a sentence.
  68. % This file was originally copied from newapa.bst at ymir.claremont.edu.
  69. % Features of chicago.bst:
  70. % =======================
  71. % - full names used in citations, but abbreviated citations are available
  72. %   (see above)
  73. % - if an entry has a "month", then the month and year are also printed
  74. %   as part of that bibitem.
  75. % - all conjunctions use "and" instead of "\&"
  76. % - major modification from Chicago Manual of Style (13th ed.) is that
  77. %   only the first author in a reference appears last name first-
  78. %   additional authors appear as J. Q. Public.
  79. % - pages are listed as "pp. xx-xx" in all entry types except
  80. %   article entries.
  81. % - book, inbook, and manual use "location: publisher" (or organization)
  82. %   for address and publisher. All other types list publishers separately.
  83. % - "pp." are used to identify page numbers for all entry types except
  84. %   articles.
  85. % - organization is used as a citation label if neither author nor editor
  86. %   is present (for manuals).
  87. % - "et al." is used for long author and editor lists, or when "others"
  88. %   is used.
  89. % Modifications and bug fixes from newapa.bst:
  90. % ===========================================
  91. %   - added month, year to bib entries if month is present
  92. %   - fixed bug with In proceedings, added necessary comma after title
  93. %   - all conjunctions changed to "and" from "\&"
  94. %   - fixed bug with author labels in my.full.label: "et al." now is
  95. %        generated when "others" is an author name
  96. %   - major modification from Chicago Manual of Style (13th ed.) is that
  97. %     only the first author in a reference appears last name first-
  98. %     additional authors appear as J. Q. Public.
  99. %   - pages are listed as "pp. xx-xx" in all entry types except
  100. %     article entries. Unnecessary (IMHO) "()" around page numbers
  101. %     were removed, and page numbers now don't end with a period.
  102. %   - created chicago.sty for use with this bibstyle (required).
  103. %   - fixed bugs in FUNCTION {format.vol.num.pages} for missing volume,
  104. %     number, and /or pages. Renamed to format.jour.vol.
  105. %   - fixed bug in formatting booktitles: additional period an error if
  106. %     book has a volume.
  107. %   - fixed bug: editors usually given redundant period before next clause
  108. %     (format.editors.dot) removed.
  109. %   - added label support for organizations, if both author and editor
  110. %     are missing (from alpha.bst). If organization is too long, then
  111. %     the key field is used for abbreviated citations.
  112. %   - In proceedings or books of several volumes, no comma was written
  113. %     between the "Volume x" and the page numbers (this was intentional
  114. %     in newapa.bst). Fixed.
  115. %   - Some journals may not have volumes/numbers, only month/year (eg.
  116. %     IEEE Computer). Fixed bug in article style that assumed volume/number
  117. %     was always present.
  118. % Original documentation for newapa.sty:
  119. % =====================================
  120. % This version was made by modifying the master file made by
  121. % Oren Patashnik (PATASHNIK@SCORE.STANFORD.EDU), and the 'named' BibTeX
  122. % style of Peter F. Patel-Schneider.
  123. % Copyright (C) 1985, all rights reserved.
  124. % Copying of this file is authorized only if either
  125. % (1) you make absolutely no changes to your copy, including name, or
  126. % (2) if you do make changes, you name it something other than 'newapa.bst'.
  127. % There are undoubtably bugs in this style.  If you make bug fixes,
  128. % improvements, etc.  please let me know.  My e-mail address is:
  129. %    spencer@cgrg.ohio.state.edu or 71160.3141@compuserve.com
  130. % This style was made from 'plain.bst', 'named.bst', and 'apalike.bst',
  131. % with lots of tweaking to make it look like APA style, along with tips
  132. % from Young Ryu and Brian Reiser's modifications of 'apalike.bst'.
  133. ENTRY
  134.   { address
  135.     author
  136.     booktitle
  137.     chapter
  138.     edition
  139.     editor
  140.     howpublished
  141.     institution
  142.     journal
  143.     key
  144.     month
  145.     note
  146.     number
  147.     organization
  148.     pages
  149.     publisher
  150.     school
  151.     series
  152.     title
  153.     type
  154.     volume
  155.     year
  156.   { label.year extra.label sort.year sort.label }
  157. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  158. FUNCTION {init.state.consts}
  159. { #0 'before.all :=
  160.   #1 'mid.sentence :=
  161.   #2 'after.sentence :=
  162.   #3 'after.block :=
  163. STRINGS { s t u }
  164. FUNCTION {output.nonnull}
  165. { 's :=
  166.   output.state mid.sentence =
  167.     { ", " * write$ }
  168.     { output.state after.block =
  169.     { add.period$ write$
  170.       newline$
  171.       "\newblock " write$
  172.     }
  173.     { output.state before.all =
  174.         'write$
  175.         { add.period$ " " * write$ }
  176.       if$
  177.     }
  178.       if$
  179.       mid.sentence 'output.state :=
  180.     }
  181.   if$
  182. % Use a colon to separate output. Used only for address/publisher
  183. % combination in book/inbook types, address/institution for manuals,
  184. % and organization:publisher for proceedings (inproceedings).
  185. FUNCTION {output.nonnull.colon}
  186. { 's :=
  187.   output.state mid.sentence =
  188.     { ": " * write$ }
  189.     { output.state after.block =
  190.     { add.period$ write$
  191.       newline$
  192.       "\newblock " write$
  193.     }
  194.     { output.state before.all =
  195.         'write$
  196.         { add.period$ " " * write$ }
  197.       if$
  198.     }
  199.       if$
  200.       mid.sentence 'output.state :=
  201.     }
  202.   if$
  203. FUNCTION {output}
  204. { duplicate$ empty$
  205.     'pop$
  206.     'output.nonnull
  207.   if$
  208. FUNCTION {output.colon}
  209. { duplicate$ empty$
  210.     'pop$
  211.     'output.nonnull.colon
  212.   if$
  213. FUNCTION {output.check}
  214. { 't :=
  215.   duplicate$ empty$
  216.     { pop$ "empty " t * " in " * cite$ * warning$ }
  217.     'output.nonnull
  218.   if$
  219. FUNCTION {output.check.colon}
  220. { 't :=
  221.   duplicate$ empty$
  222.     { pop$ "empty " t * " in " * cite$ * warning$ }
  223.     'output.nonnull.colon
  224.   if$
  225. FUNCTION {output.year.check}
  226. { year empty$
  227.      { "empty year in " cite$ * warning$ }
  228.      { write$
  229.         " (" year * extra.label *
  230.        month empty$
  231.           { ")" * }
  232.           { ", " * month * ")" * }
  233.        if$
  234.        mid.sentence 'output.state :=
  235.      }
  236.   if$
  237. FUNCTION {fin.entry}
  238. { add.period$
  239.   write$
  240.   newline$
  241. FUNCTION {new.block}
  242. { output.state before.all =
  243.     'skip$
  244.     { after.block 'output.state := }
  245.   if$
  246. FUNCTION {new.sentence}
  247. { output.state after.block =
  248.     'skip$
  249.     { output.state before.all =
  250.     'skip$
  251.     { after.sentence 'output.state := }
  252.       if$
  253.     }
  254.   if$
  255. FUNCTION {not}
  256. {   { #0 }
  257.     { #1 }
  258.   if$
  259. FUNCTION {and}
  260. {   'skip$
  261.     { pop$ #0 }
  262.   if$
  263. FUNCTION {or}
  264. {   { pop$ #1 }
  265.     'skip$
  266.   if$
  267. FUNCTION {new.block.checka}
  268. { empty$
  269.     'skip$
  270.     'new.block
  271.   if$
  272. FUNCTION {new.block.checkb}
  273. { empty$
  274.   swap$ empty$
  275.   and
  276.     'skip$
  277.     'new.block
  278.   if$
  279. FUNCTION {new.sentence.checka}
  280. { empty$
  281.     'skip$
  282.     'new.sentence
  283.   if$
  284. FUNCTION {new.sentence.checkb}
  285. { empty$
  286.   swap$ empty$
  287.   and
  288.     'skip$
  289.     'new.sentence
  290.   if$
  291. FUNCTION {field.or.null}
  292. { duplicate$ empty$
  293.     { pop$ "" }
  294.     'skip$
  295.   if$
  296. % Emphasize the top string on the stack.
  297. FUNCTION {emphasize}
  298. { duplicate$ empty$
  299.     { pop$ "" }
  300.     { "{\em " swap$ * "}" * }
  301.   if$
  302. % Emphasize the top string on the stack, but add a trailing space.
  303. FUNCTION {emphasize.space}
  304. { duplicate$ empty$
  305.     { pop$ "" }
  306.     { "{\em " swap$ * "\/}" * }
  307.   if$
  308. INTEGERS { nameptr namesleft numnames }
  309. % Format bibliographical entries with the first author last name first,
  310. % and subsequent authors with initials followed by last name.
  311. % All names are formatted in this routine.
  312. FUNCTION {format.names}
  313. { 's :=
  314.   #1 'nameptr :=               % nameptr = 1;
  315.   s num.names$ 'numnames :=    % numnames = num.name$(s);
  316.   numnames 'namesleft :=
  317.     { namesleft #0 > }
  318.     { nameptr #1 =
  319.         {s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't := }
  320.         {s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := }
  321.       if$
  322.       nameptr #1 >
  323.         { namesleft #1 >
  324.               { ", " * t * }
  325.               { numnames #2 >
  326.                   { "," * }
  327.                   'skip$
  328.                 if$
  329.                 t "others" =
  330.                     { " et~al." * }
  331.                     { " and " * t * } % from Chicago Manual of Style
  332.                   if$
  333.                }
  334.                if$
  335.              }
  336.             't
  337.         if$
  338.         nameptr #1 + 'nameptr :=          % nameptr += 1;
  339.         namesleft #1 - 'namesleft :=      % namesleft =- 1;
  340.     }
  341.   while$
  342. FUNCTION {my.full.label}
  343. { 's :=
  344.   #1 'nameptr :=               % nameptr = 1;
  345.   s num.names$ 'numnames :=    % numnames = num.name$(s);
  346.   numnames 'namesleft :=
  347.     { namesleft #0 > }
  348.     { s nameptr "{vv~}{ll}" format.name$ 't :=  % get the next name
  349.       nameptr #1 >
  350.         { namesleft #1 >
  351.               { ", " * t * }
  352.               { numnames #2 >
  353.                   { "," * }
  354.                   'skip$
  355.                 if$
  356.                 t "others" =
  357.                     { " et~al." * }
  358.                     { " and " * t * } % from Chicago Manual of Style
  359.                   if$
  360.                }
  361.                if$
  362.              }
  363.             't
  364.         if$
  365.         nameptr #1 + 'nameptr :=          % nameptr += 1;
  366.         namesleft #1 - 'namesleft :=      % namesleft =- 1;
  367.     }
  368.   while$
  369. FUNCTION {format.names.fml}
  370. % Format names in "familiar" format, with first initial followed by
  371. % last name. Like format.names, ALL names are formatted.
  372. { 's :=
  373.   #1 'nameptr :=               % nameptr = 1;
  374.   s num.names$ 'numnames :=    % numnames = num.name$(s);
  375.   numnames 'namesleft :=
  376.     { namesleft #0 > }
  377.     { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
  378.       nameptr #1 >
  379.         { namesleft #1 >
  380.               { ", " * t * }
  381.                { numnames #2 >
  382.                     { "," * }
  383.                     'skip$
  384.                   if$
  385.                   t "others" =
  386.                         { " et~al." * }
  387.                         { " and " * t * }
  388. %                       { " \& " * t * }
  389.                       if$
  390.                 }
  391.                if$
  392.              }
  393.             't
  394.         if$
  395.         nameptr #1 + 'nameptr :=          % nameptr += 1;
  396.         namesleft #1 - 'namesleft :=      % namesleft =- 1;
  397.     }
  398.   while$
  399. FUNCTION {format.authors}
  400. { author empty$
  401.     { "" }
  402.     { author format.names }
  403.   if$
  404. FUNCTION {format.key}
  405. { empty$
  406.     { key field.or.null }
  407.     { "" }
  408.   if$
  409. % Format editor names for use in the "in" types: inbook, incollection,
  410. % inproceedings: first initial, then last names. When editors are the
  411. % LABEL for an entry, then format.editor is used which lists editors
  412. % by last name first.
  413. FUNCTION {format.editors.fml}
  414. { editor empty$
  415.     { "" }
  416.     { editor format.names.fml
  417.       editor num.names$ #1 >
  418.     { " (Eds.)" * }
  419.     { " (Ed.)" * }
  420.       if$
  421.     }
  422.   if$
  423. % Format editor names for use in labels, last names first.
  424. FUNCTION {format.editors}
  425. { editor empty$
  426.     { "" }
  427.     { editor format.names
  428.       editor num.names$ #1 >
  429.     { " (Eds.)" * }
  430.     { " (Ed.)" * }
  431.       if$
  432.     }
  433.   if$
  434. FUNCTION {format.title}
  435. { title empty$
  436.     { "" }
  437.     { title "t" change.case$ }
  438.   if$
  439. % Note that the APA style requres case changes
  440. % in article titles. The following does not
  441. % change cases. If you perfer it, uncomment the
  442. % following and comment out the above.
  443. %FUNCTION {format.title}
  444. %{ title empty$
  445. %    { "" }
  446. %    { title }
  447. %  if$
  448. FUNCTION {n.dashify}
  449. { 't :=
  450.     { t empty$ not }
  451.     { t #1 #1 substring$ "-" =
  452.     { t #1 #2 substring$ "--" = not
  453.         { "--" *
  454.           t #2 global.max$ substring$ 't :=
  455.         }
  456.         {   { t #1 #1 substring$ "-" = }
  457.         { "-" *
  458.           t #2 global.max$ substring$ 't :=
  459.         }
  460.           while$
  461.         }
  462.       if$
  463.     }
  464.     { t #1 #1 substring$ *
  465.       t #2 global.max$ substring$ 't :=
  466.     }
  467.       if$
  468.     }
  469.   while$
  470. FUNCTION {format.btitle}
  471. { edition empty$
  472.   { title emphasize }
  473.   { title empty$
  474.     { title emphasize }
  475.     { volume empty$     % gnp - check for volume, then don't need period
  476.        { "{\em " title * "\/} (" * edition * " ed.)" * "." * }
  477.        { "{\em " title * "\/} (" * edition * " ed.)" * }
  478.       if$
  479.     }
  480.     if$
  481.   if$
  482. FUNCTION {format.emphasize.booktitle}
  483. { edition empty$
  484.   { booktitle emphasize }
  485.   { booktitle empty$
  486.     { booktitle emphasize }
  487.     { volume empty$    % gnp - extra period an error if book has a volume
  488.         { "{\em " booktitle * "\/} (" * edition * " ed.)" * "." *}
  489.         { "{\em " booktitle * "\/} (" * edition * " ed.)" * }
  490.       if$
  491.       }
  492.     if$
  493.     }
  494.   if$
  495. FUNCTION {tie.or.space.connect}
  496. { duplicate$ text.length$ #3 <
  497.     { "~" }
  498.     { " " }
  499.   if$
  500.   swap$ * *
  501. FUNCTION {either.or.check}
  502. { empty$
  503.     'pop$
  504.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  505.   if$
  506. FUNCTION {format.bvolume}
  507. { volume empty$
  508.     { "" }
  509.     { "Volume" volume tie.or.space.connect % gnp - changed to mixed case
  510.       series empty$
  511.         'skip$
  512.         { " of " * series emphasize * }
  513.       if$
  514.       "volume and number" number either.or.check
  515.     }
  516.   if$
  517. FUNCTION {format.number.series}
  518. { volume empty$
  519.     { number empty$
  520.     { series field.or.null }
  521.     { output.state mid.sentence =
  522.         { "Number" } % gnp - changed to mixed case always
  523.         { "Number" }
  524.       if$
  525.       number tie.or.space.connect
  526.       series empty$
  527.         { "there's a number but no series in " cite$ * warning$ }
  528.         { " in " * series * }
  529.       if$
  530.     }
  531.       if$
  532.     }
  533.     { "" }
  534.   if$
  535. INTEGERS { multiresult }
  536. FUNCTION {multi.page.check}
  537. { 't :=
  538.   #0 'multiresult :=
  539.     { multiresult not
  540.       t empty$ not
  541.       and
  542.     }
  543.     { t #1 #1 substring$
  544.       duplicate$ "-" =
  545.       swap$ duplicate$ "," =
  546.       swap$ "+" =
  547.       or or
  548.     { #1 'multiresult := }
  549.     { t #2 global.max$ substring$ 't := }
  550.       if$
  551.     }
  552.   while$
  553.   multiresult
  554. FUNCTION {format.pages}
  555. { pages empty$
  556.   { "" }
  557.   { pages multi.page.check
  558.     { "pp.\ " pages n.dashify tie.or.space.connect } % gnp - removed ()
  559.     { "pp.\ " pages tie.or.space.connect }
  560.     if$
  561.   if$
  562. % By Young (and Spencer)
  563. % GNP - fixed bugs with missing volume, number, and/or pages
  564. % Format journal, volume, number, pages for article types.
  565. FUNCTION {format.jour.vol}
  566. { journal empty$
  567.     { "no journal in " cite$ * warning$
  568.       "" }
  569.     { journal emphasize.space }
  570.     if$
  571.   number empty$
  572.     { volume empty$
  573.        { "no number and no volume in " cite$ * warning$
  574.          "" * }
  575.        { "~{\em " * Volume * "}" * }
  576.       if$
  577.     }
  578.     { volume empty$
  579.       {"no volume for " cite$ * warning$
  580.        "~(" * number * ")" * }
  581.       { "~" *
  582.         volume emphasize.space
  583.         "(" * number * ")" * * }
  584.       if$
  585.     }
  586.   if$
  587.   pages empty$
  588.     {"page numbers missing in " cite$ * warning$
  589.      "" * } % gnp - place a null string on the stack for output
  590.     { duplicate$ empty$
  591.       { pop$ format.pages }
  592.       { ", " *  pages n.dashify * } % gnp - removed pp. for articles
  593.       if$
  594.     }
  595.   if$
  596. FUNCTION {format.chapter.pages}
  597. { chapter empty$
  598.     'format.pages
  599.     { type empty$
  600.         { "Chapter" } % gnp - changed to mixed case
  601.         { type "t" change.case$ }
  602.       if$
  603.       chapter tie.or.space.connect
  604.       pages empty$
  605.         {"page numbers missing in " cite$ * warning$} % gnp - added check
  606.         { ", " * format.pages * }
  607.       if$
  608.     }
  609.   if$
  610. FUNCTION {format.in.ed.booktitle}
  611. { booktitle empty$
  612.   { "" }
  613.   { editor empty$
  614.     { "In " format.emphasize.booktitle * }
  615.     { "In " format.editors.fml * ", " * format.emphasize.booktitle * }
  616.     if$
  617.   if$
  618. FUNCTION {format.thesis.type}
  619. { type empty$
  620.     'skip$
  621.     { pop$
  622.       type "t" change.case$
  623.     }
  624.   if$
  625. FUNCTION {format.tr.number}
  626. { type empty$
  627.     { "Technical Report" }
  628.     'type
  629.   if$
  630.   number empty$
  631.     { "t" change.case$ }
  632.     { number tie.or.space.connect }
  633.   if$
  634. FUNCTION {format.article.crossref}
  635. { "See"
  636.   "\citeN{" * crossref * "}" *
  637. FUNCTION {format.crossref.editor}
  638. { editor #1 "{vv~}{ll}" format.name$
  639.   editor num.names$ duplicate$
  640.   #2 >
  641.     { pop$ " et~al." * }
  642.     { #2 <
  643.     'skip$
  644.     { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  645.         { " et~al." * }
  646.         { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  647.       if$
  648.     }
  649.       if$
  650.     }
  651.   if$
  652. FUNCTION {format.book.crossref}
  653. { volume empty$
  654.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  655.       "In "
  656.     }
  657.     { "Volume" volume tie.or.space.connect % gnp - changed to mixed case
  658.       " of " *
  659.     }
  660.   if$
  661.   editor empty$
  662.   editor field.or.null author field.or.null =
  663.     { key empty$
  664.     { series empty$
  665.         { "need editor, key, or series for " cite$ * " to crossref " *
  666.           crossref * warning$
  667.           "" *
  668.         }
  669.         { "{\em " * series * "\/}" * }
  670.       if$
  671.     }
  672.     { key * }
  673.       if$
  674.     }
  675.     { format.crossref.editor * }
  676.   if$
  677.   " \citeN{" * crossref * "}" *
  678. FUNCTION {format.incoll.inproc.crossref}
  679. { "See"
  680.   " \citeN{" * crossref * "}" *
  681. % format.lab.names:
  682. % determines "short" names for the abbreviated author information.
  683. % "Long" labels are created in calc.label, using the routine my.full.label
  684. % to format author and editor fields.
  685. % There are 4 cases for labels.   (n=3 in the example)
  686. % a) one author             Foo
  687. % b) one to n               Foo, Bar and Baz
  688. % c) use of "and others"    Foo, Bar et al.
  689. % d) more than n            Foo et al.
  690. FUNCTION {format.lab.names}
  691. { 's :=
  692.   s num.names$ 'numnames :=
  693.   numnames #2 >    % change number to number of others allowed before
  694.            % forcing "et al".
  695.     { s #1 "{vv~}{ll}" format.name$ " et~al." * }
  696.     {
  697.       numnames #1 - 'namesleft :=
  698.       #2 'nameptr :=
  699.       s #1 "{vv~}{ll}" format.name$
  700.     { namesleft #0 > }
  701.     { nameptr numnames =
  702.         { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  703.         { " et~al." * }
  704.         { " and " * s nameptr "{vv~}{ll}" format.name$ * }
  705.           if$
  706.         }
  707.         { ", " * s nameptr "{vv~}{ll}" format.name$ * }
  708.       if$
  709.       nameptr #1 + 'nameptr :=
  710.       namesleft #1 - 'namesleft :=
  711.       while$
  712.     }
  713.   if$
  714. FUNCTION {author.key.label}
  715. { author empty$
  716.     { key empty$
  717.           { "no key, author in " cite$ * warning$
  718.             cite$ #1 #3 substring$ }
  719.          'key
  720.       if$
  721.     }
  722.     { author format.lab.names }
  723.   if$
  724. FUNCTION {editor.key.label}
  725. { editor empty$
  726.     { key empty$
  727.           { "no key, editor in " cite$ * warning$
  728.             cite$ #1 #3 substring$ }
  729.           'key
  730.         if$
  731.      }
  732.      { editor format.lab.names }
  733.   if$
  734. FUNCTION {author.key.organization.label}
  735. % added - gnp. Provide label formatting by organization if author is null.
  736. { author empty$
  737.     { organization empty$
  738.     { key empty$
  739.         { "no key, author or organization in " cite$ * warning$
  740.               cite$ #1 #3 substring$ }
  741.         'key
  742.       if$
  743.         { organization }
  744.       if$
  745.     }
  746.     { author format.lab.names }
  747.   if$
  748. FUNCTION {editor.key.organization.label}
  749. % added - gnp. Provide label formatting by organization if editor is null.
  750. { editor empty$
  751.     { organization empty$
  752.     { key empty$
  753.         { "no key, editor or organization in " cite$ * warning$
  754.               cite$ #1 #3 substring$ }
  755.         'key
  756.       if$
  757.         { organization }
  758.       if$
  759.     }
  760.     { editor format.lab.names }
  761.   if$
  762. FUNCTION {author.editor.key.label}
  763. { author empty$
  764.     { editor empty$
  765.           { key empty$
  766.                { "no key, author, or editor in " cite$ * warning$
  767.                  cite$ #1 #3 substring$ }
  768.              'key
  769.            if$
  770.          }
  771.           { editor format.lab.names }
  772.       if$
  773.     }
  774.     { author format.lab.names }
  775.   if$
  776. FUNCTION {calc.label}
  777. % Changed - GNP. See also author.organization.sort, editor.organization.sort
  778. % Form label for BibTeX entry. The classification of which fields are used
  779. % for which type of entry (book, inbook, etc.) are taken from alpha.bst.
  780. % The change here from newapa is to also include organization as a
  781. % citation label if author or editor is missing.
  782. { type$ "book" =
  783.   type$ "inbook" =
  784.     'author.editor.key.label
  785.     { type$ "proceedings" =
  786.     'editor.key.organization.label
  787.     { type$ "manual" =
  788.         'author.key.organization.label
  789.         'author.key.label
  790.       if$
  791.       if$
  792.     }
  793.   if$
  794.   author empty$  % generate the full label citation information.
  795.     { editor empty$
  796.         { organization empty$
  797.            { "no author, editor, or organization in " cite$ * warning$
  798.              "??" }
  799.            { organization }
  800.            if$
  801.         }
  802.         { editor my.full.label }
  803.         if$
  804.     }
  805.     { author my.full.label }
  806.   if$
  807. % leave label on the stack, to be popped when required.
  808.   "}{" * swap$ * "}{" *
  809. %  year field.or.null purify$ #-1 #4 substring$ *
  810. % save the year for sort processing afterwards (adding a, b, c, etc.)
  811.   year field.or.null purify$ #-1 #4 substring$
  812.   'label.year :=
  813. FUNCTION {output.bibitem}
  814. { newline$
  815.   "\bibitem[\protect\citeauthoryear{" write$
  816.   calc.label write$
  817.   sort.year write$
  818.   "}]{" write$
  819.   cite$ write$
  820.   "}" write$
  821.   newline$
  822.   before.all 'output.state :=
  823. FUNCTION {article}
  824. { output.bibitem
  825.   format.authors
  826.   "author" output.check
  827.   author format.key output          % added
  828.   output.year.check                 % added
  829.   new.block
  830.   format.title
  831.   "title" output.check
  832.   new.block
  833.   crossref missing$
  834.     { format.jour.vol output
  835.     }
  836.     { format.article.crossref output.nonnull
  837.       format.pages output
  838.     }
  839.   if$
  840.   fin.entry
  841. FUNCTION {book}
  842. { output.bibitem
  843.   author empty$
  844.     { format.editors
  845.       "author and editor" output.check }
  846.     { format.authors
  847.       output.nonnull
  848.       crossref missing$
  849.         { "author and editor" editor either.or.check }
  850.         'skip$
  851.       if$
  852.     }
  853.   if$
  854.   output.year.check       % added
  855.   new.block
  856.   format.btitle
  857.   "title" output.check
  858.   crossref missing$
  859.     { format.bvolume output
  860.       new.block
  861.       format.number.series output
  862.       new.sentence
  863.       address output
  864.       publisher "publisher" output.check.colon
  865.     }
  866.     { new.block
  867.       format.book.crossref output.nonnull
  868.     }
  869.   if$
  870.   fin.entry
  871. FUNCTION {booklet}
  872. { output.bibitem
  873.   format.authors output
  874.   author format.key output          % added
  875.   output.year.check                 % added
  876.   new.block
  877.   format.title
  878.   "title" output.check
  879.   new.block
  880.   howpublished output
  881.   address output
  882.   new.block
  883.   note output
  884.   fin.entry
  885. FUNCTION {inbook}
  886. { output.bibitem
  887.   author empty$
  888.     { format.editors
  889.       "author and editor" output.check
  890.     }
  891.     { format.authors output.nonnull
  892.       crossref missing$
  893.     { "author and editor" editor either.or.check }
  894.     'skip$
  895.       if$
  896.     }
  897.   if$
  898.   output.year.check                 % added
  899.   new.block
  900.   format.btitle
  901.   "title" output.check
  902.   crossref missing$
  903.     { format.bvolume output
  904.       format.chapter.pages
  905.       "chapter and pages" output.check
  906.       new.block
  907.       format.number.series output
  908.       new.sentence
  909.       address output
  910.       publisher
  911.       "publisher" output.check.colon
  912.     }
  913.     { format.chapter.pages "chapter and pages" output.check
  914.       new.block
  915.       format.book.crossref output.nonnull
  916.     }
  917.   if$
  918.   new.block
  919.   note output
  920.   fin.entry
  921. FUNCTION {incollection}
  922. { output.bibitem
  923.   format.authors
  924.   "author" output.check
  925.   author format.key output       % added
  926.   output.year.check              % added
  927.   new.block
  928.   format.title
  929.   "title" output.check
  930.   new.block
  931.   crossref missing$
  932.   { format.in.ed.booktitle
  933.     "booktitle" output.check
  934.     format.bvolume output
  935.     format.number.series output
  936.     format.chapter.pages output % gnp - was special.output.nonnull
  937. %                                 left out comma before page numbers
  938.     new.sentence
  939.     address output
  940.     publisher "publisher" output.check.colon
  941.   { format.incoll.inproc.crossref
  942.     output.nonnull
  943.     format.chapter.pages output
  944.   if$
  945.   new.block
  946.   note output
  947.   fin.entry
  948. FUNCTION {inproceedings}
  949. { output.bibitem
  950.   format.authors
  951.   "author" output.check
  952.   author format.key output            % added
  953.   output.year.check                   % added
  954.   new.block
  955.   format.title
  956.   "title" output.check
  957.   new.block
  958.   crossref missing$
  959.     { format.in.ed.booktitle
  960.       "booktitle" output.check
  961.       format.bvolume output
  962.       format.number.series output
  963.       address output
  964.       format.pages output
  965.       new.sentence
  966.       organization output
  967.       publisher output.colon
  968.       }
  969.     { format.incoll.inproc.crossref output.nonnull
  970.       format.pages output
  971.     }
  972.   if$
  973.   new.block
  974.   note output
  975.   fin.entry
  976. FUNCTION {conference} { inproceedings }
  977. FUNCTION {manual}
  978. { output.bibitem
  979.   author empty$
  980.     { editor empty$
  981.       { organization "organization" output.check
  982.         organization format.key output }  % if all else fails, use key
  983.       { format.editors "author and editor" output.check }
  984.       if$
  985.     }
  986.     { format.authors output.nonnull }
  987.     if$
  988.   output.year.check                 % added
  989.   new.block
  990.   format.btitle
  991.   "title" output.check
  992.   organization address new.block.checkb
  993. % Reversed the order of "address" and "organization", added the ":".
  994.   address output
  995.   organization "organization" output.check.colon
  996. %  address output
  997. %  ":" output
  998. %  organization output
  999.   new.block
  1000.   note output
  1001.   fin.entry
  1002. FUNCTION {mastersthesis}
  1003. { output.bibitem
  1004.   format.authors
  1005.   "author" output.check
  1006.   author format.key output          % added
  1007.   output.year.check                 % added
  1008.   new.block
  1009.   format.title
  1010.   "title" output.check
  1011.   new.block
  1012.   "Master's thesis" format.thesis.type output.nonnull
  1013.   school "school" output.check
  1014.   address output
  1015.   new.block
  1016.   note output
  1017.   fin.entry
  1018. FUNCTION {misc}
  1019. { output.bibitem
  1020.   format.authors output
  1021.   author format.key output            % added
  1022.   output.year.check                   % added
  1023.   title howpublished new.block.checkb
  1024.   format.title output
  1025.   new.block
  1026.   howpublished output
  1027.   new.block
  1028.   note output
  1029.   fin.entry
  1030. FUNCTION {phdthesis}
  1031. { output.bibitem
  1032.   format.authors
  1033.   "author" output.check
  1034.   author format.key output            % added
  1035.   output.year.check                   % added
  1036.   new.block
  1037.   format.btitle
  1038.   "title" output.check
  1039.   new.block
  1040.   "Ph.\ D. thesis" format.thesis.type output.nonnull
  1041.   school "school" output.check
  1042.   address output
  1043.   new.block
  1044.   note output
  1045.   fin.entry
  1046. FUNCTION {proceedings}
  1047. { output.bibitem
  1048.   editor empty$
  1049.     { organization output
  1050.       organization format.key output }  % gnp - changed from author format.key
  1051.     { format.editors output.nonnull }
  1052.   if$
  1053. % author format.key output             % gnp - removed (should be either
  1054. %                                        editor or organization
  1055.   output.year.check                    % added (newapa)
  1056.   new.block
  1057.   format.btitle
  1058.   "title" output.check
  1059.   format.bvolume output
  1060.   format.number.series output
  1061.   address output
  1062.   new.sentence
  1063.   organization output
  1064.   publisher output.colon
  1065.   new.block
  1066.   note output
  1067.   fin.entry
  1068. FUNCTION {techreport}
  1069. { output.bibitem
  1070.   format.authors
  1071.   "author" output.check
  1072.   author format.key output             % added
  1073.   output.year.check                    % added
  1074.   new.block
  1075.   format.title
  1076.   "title" output.check
  1077.   new.block
  1078.   format.tr.number output.nonnull
  1079.   institution
  1080.   "institution" output.check
  1081.   address output
  1082.   new.block
  1083.   note output
  1084.   fin.entry
  1085. FUNCTION {unpublished}
  1086. { output.bibitem
  1087.   format.authors
  1088.   "author" output.check
  1089.   author format.key output              % added
  1090.   output.year.check                      % added
  1091.   new.block
  1092.   format.title
  1093.   "title" output.check
  1094.   new.block
  1095.   note "note" output.check
  1096.   fin.entry
  1097. FUNCTION {default.type} { misc }
  1098. MACRO {jan} {"January"}
  1099. MACRO {feb} {"February"}
  1100. MACRO {mar} {"March"}
  1101. MACRO {apr} {"April"}
  1102. MACRO {may} {"May"}
  1103. MACRO {jun} {"June"}
  1104. MACRO {jul} {"July"}
  1105. MACRO {aug} {"August"}
  1106. MACRO {sep} {"September"}
  1107. MACRO {oct} {"October"}
  1108. MACRO {nov} {"November"}
  1109. MACRO {dec} {"December"}
  1110. MACRO {acmcs} {"ACM Computing Surveys"}
  1111. MACRO {acta} {"Acta Informatica"}
  1112. MACRO {ai} {"Artificial Intelligence"}
  1113. MACRO {cacm} {"Communications of the ACM"}
  1114. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  1115. MACRO {ibmsj} {"IBM Systems Journal"}
  1116. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  1117. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  1118. MACRO {ieeetcad}
  1119.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  1120. MACRO {ipl} {"Information Processing Letters"}
  1121. MACRO {jacm} {"Journal of the ACM"}
  1122. MACRO {jcss} {"Journal of Computer and System Sciences"}
  1123. MACRO {scp} {"Science of Computer Programming"}
  1124. MACRO {sicomp} {"SIAM Journal on Computing"}
  1125. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  1126. MACRO {tods} {"ACM Transactions on Database Systems"}
  1127. MACRO {tog} {"ACM Transactions on Graphics"}
  1128. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  1129. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  1130. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  1131. MACRO {tcs} {"Theoretical Computer Science"}
  1132. FUNCTION {sortify}
  1133. { purify$
  1134.   "l" change.case$
  1135. INTEGERS { len }
  1136. FUNCTION {chop.word}
  1137. { 's :=
  1138.   'len :=
  1139.   s #1 len substring$ =
  1140.     { s len #1 + global.max$ substring$ }
  1141.     's
  1142.   if$
  1143. FUNCTION {sort.format.names}
  1144. { 's :=
  1145.   #1 'nameptr :=
  1146.   s num.names$ 'numnames :=
  1147.   numnames 'namesleft :=
  1148.     { namesleft #0 > }
  1149.     { nameptr #1 >
  1150.           { "   " * }
  1151.          'skip$
  1152.       if$
  1153.       s nameptr "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}" format.name$ 't :=
  1154.       nameptr numnames = t "others" = and
  1155.           { " et~al" * }
  1156.           { t sortify * }
  1157.       if$
  1158.       nameptr #1 + 'nameptr :=
  1159.       namesleft #1 - 'namesleft :=
  1160.     }
  1161.   while$
  1162. FUNCTION {sort.format.title}
  1163. { 't :=
  1164.   "A " #2
  1165.     "An " #3
  1166.       "The " #4 t chop.word
  1167.     chop.word
  1168.   chop.word
  1169.   sortify
  1170.   #1 global.max$ substring$
  1171. FUNCTION {author.sort}
  1172. { author empty$
  1173.     { key empty$
  1174.          { "to sort, need author or key in " cite$ * warning$
  1175.            "" }
  1176.          { key sortify }
  1177.       if$
  1178.     }
  1179.     { author sort.format.names }
  1180.   if$
  1181. FUNCTION {editor.sort}
  1182. { editor empty$
  1183.     { key empty$
  1184.          { "to sort, need editor or key in " cite$ * warning$
  1185.            ""
  1186.          }
  1187.          { key sortify }
  1188.       if$
  1189.     }
  1190.     { editor sort.format.names }
  1191.   if$
  1192. FUNCTION {author.editor.sort}
  1193. { author empty$
  1194.     { "missing author in " cite$ * warning$
  1195.       editor empty$
  1196.          { key empty$
  1197.              { "to sort, need author, editor, or key in " cite$ * warning$
  1198.                ""
  1199.              }
  1200.              { key sortify }
  1201.            if$
  1202.          }
  1203.          { editor sort.format.names }
  1204.       if$
  1205.     }
  1206.     { author sort.format.names }
  1207.   if$
  1208. FUNCTION {author.organization.sort}
  1209. % added - GNP. Stack author or organization for sorting (from alpha.bst).
  1210. % Unlike alpha.bst, we need entire names, not abbreviations
  1211. { author empty$
  1212.     { organization empty$
  1213.     { key empty$
  1214.         { "to sort, need author, organization, or key in " cite$ * warning$
  1215.           ""
  1216.         }
  1217.         { key sortify }
  1218.       if$
  1219.     { organization sortify }
  1220.       if$
  1221.     }
  1222.     { author sort.format.names }
  1223.   if$
  1224. FUNCTION {editor.organization.sort}
  1225. % added - GNP. Stack editor or organization for sorting (from alpha.bst).
  1226. % Unlike alpha.bst, we need entire names, not abbreviations
  1227. { editor empty$
  1228.     { organization empty$
  1229.     { key empty$
  1230.         { "to sort, need editor, organization, or key in " cite$ * warning$
  1231.           ""
  1232.         }
  1233.         { key sortify }
  1234.       if$
  1235.     { organization sortify }
  1236.       if$
  1237.     }
  1238.     { editor sort.format.names }
  1239.   if$
  1240. FUNCTION {presort}
  1241. % Presort creates the bibentry's label via a call to calc.label, and then
  1242. % sorts the entries based on entry type. Chicago.bst adds support for
  1243. % including organizations as the sort key; the following is stolen from
  1244. % alpha.bst.
  1245. { calc.label sortify % recalculate bibitem label
  1246.   year field.or.null purify$ #-1 #4 substring$ * % add year
  1247.   "    "
  1248.   type$ "book" =
  1249.   type$ "inbook" =
  1250.     'author.editor.sort
  1251.     { type$ "proceedings" =
  1252.     'editor.organization.sort
  1253.     { type$ "manual" =
  1254.         'author.organization.sort
  1255.         'author.sort
  1256.       if$
  1257.       if$
  1258.     }
  1259.   if$
  1260.   #1 entry.max$ substring$        % added for newapa
  1261.   'sort.label :=                  % added for newapa
  1262.   sort.label                      % added for newapa
  1263.   "    "
  1264.   title field.or.null
  1265.   sort.format.title
  1266.   #1 entry.max$ substring$
  1267.   'sort.key$ :=
  1268. ITERATE {presort}
  1269. SORT             % by label, year, author/editor, title
  1270. STRINGS { last.label next.extra }
  1271. INTEGERS { last.extra.num }
  1272. FUNCTION {initialize.extra.label.stuff}
  1273. { #0 int.to.chr$ 'last.label :=
  1274.   "" 'next.extra :=
  1275.   #0 'last.extra.num :=
  1276. FUNCTION {forward.pass}
  1277. % Pass through all entries, comparing current entry to last one.
  1278. % Need to concatenate year to the stack (done by calc.label) to determine
  1279. % if two entries are the same (see presort)
  1280. { last.label
  1281.   calc.label year field.or.null purify$ #-1 #4 substring$ * % add year
  1282.   #1 entry.max$ substring$ =     % are they equal?
  1283.      { last.extra.num #1 + 'last.extra.num :=
  1284.        last.extra.num int.to.chr$ 'extra.label :=
  1285.      }
  1286.      { "a" chr.to.int$ 'last.extra.num :=
  1287.        "" 'extra.label :=
  1288.        calc.label year field.or.null purify$ #-1 #4 substring$ * % add year
  1289.        #1 entry.max$ substring$ 'last.label := % assign to last.label
  1290.      }
  1291.   if$
  1292. FUNCTION {reverse.pass}
  1293. { next.extra "b" =
  1294.     { "a" 'extra.label := }
  1295.      'skip$
  1296.   if$
  1297.   label.year extra.label * 'sort.year :=
  1298.   extra.label 'next.extra :=
  1299. EXECUTE {initialize.extra.label.stuff}
  1300. ITERATE {forward.pass}
  1301. REVERSE {reverse.pass}
  1302. FUNCTION {bib.sort.order}
  1303. { sort.label
  1304.   "    "
  1305.   year field.or.null sortify
  1306.   "    "
  1307.   title field.or.null
  1308.   sort.format.title
  1309.   #1 entry.max$ substring$
  1310.   'sort.key$ :=
  1311. ITERATE {bib.sort.order}
  1312. SORT             % by sort.label, year, title --- giving final bib. order.
  1313. FUNCTION {begin.bib}
  1314. { preamble$ empty$
  1315.     'skip$
  1316.     { preamble$ write$ newline$ }
  1317.   if$
  1318.   "\begin{thebibliography}{}" write$ newline$
  1319. EXECUTE {begin.bib}
  1320. EXECUTE {init.state.consts}
  1321. ITERATE {call.type$}
  1322. FUNCTION {end.bib}
  1323. { newline$
  1324.   "\end{thebibliography}" write$ newline$
  1325. EXECUTE {end.bib}
  1326.